*******************************
*** Fig. A.4, A.5, A.6, A.7 ***
*******************************

* load frame
frame change italian_data

levelsof regione, local(levels)
foreach r of local levels{
************ Mainstream parties ***************
* numero associazioni unemployment change

reg mainstream i.worse_econ##c.associations##i.declining_emp i.education age i.male i.election_year i.provincen if regione!="`r'", vce(cluster province)

margins declining_emp, dydx(worse_econ) at(associations=(0(4)16))
mplotoffset,  offset(0.5) recast(scatter) ///
		name(ass_dummy`r', replace) ///
		title("`r'") ///
		ytitle("", size(large)) ///
		xtitle("", size(large)) ///		
		yline(0, lw(thin) lstyle(foreground) ) ///
		ylabel(, grid glcolor(black%70) glw(thin) labs(medl)) ///
		xlabel(, nogrid) ///
		aspect(1) ///
		plot1opts(msymbol(D) msize(medium) mcolor(red) lcolor(red) lwidth(medthick)) ci1opts(lcolor(red)) ///
        plot2opts(msymbol(O) msize(medium) mcolor(blue) lp(solid)  mlcolor(blue) lcolor(blue) lwidth(medthick)) ci2opts(lcolor(blue)) ///
		legend( ///
			off)	
	
reg mainstream i.worse_econ##c.associations##i.unemp_tercile i.education age i.male i.election_year i.regionen if regione!="`r'", vce(cluster province)

margins unemp_tercile, dydx(worse_econ) at(associations=(0(4)16))
mplotoffset,  offset(0.5) recast(scatter) ///
		name(ass_ter`r', replace) ///
		title("`r'") ///
		ytitle("", size(large)) ///
		xtitle("", size(large)) ///		
		yline(0, lw(thin) lstyle(foreground) ) ///
		ylabel(, grid glcolor(black%70) glw(thin) labs(medl)) ///
		xlabel(, nogrid) ///
		aspect(1) ///
		plot1opts(msymbol(D) msize(medium) mcolor(red) lcolor(red) lwidth(medthick)) ci1opts(lcolor(red)) ///
        plot3opts(msymbol(O) msize(medium) mcolor(blue) lp(solid)  mlcolor(blue) lcolor(blue) lwidth(medthick)) ci3opts(lcolor(blue)) ///
        plot2opts(msymbol(T) msize(medium) mcolor(orange) lp(solid)  mlcolor(orange) lcolor(orange) lwidth(medthick)) ci2opts(lcolor(orange)) ///
		legend(off)
	

* numero coni association unemployment change

reg mainstream i.worse_econ##c.coni_assoc_1999##i.declining_emp i.education age i.male i.election_year i.regionen if regione!="`r'", vce(cluster regionen)

margins declining_emp, dydx(worse_econ) at(coni_assoc_1999=(0.5(.4)2.1))
mplotoffset,  offset(0.05) recast(scatter) ///
		name(coni_dummy`r', replace) ///
		title("`r'") ///
		ytitle("", size(large)) ///
		xtitle("", size(large)) ///		
		yline(0, lw(thin) lstyle(foreground) ) ///
		ylabel(, grid glcolor(black%70) glw(thin) labs(medl)) ///
		xlabel(, nogrid) ///
		aspect(1) ///
		plot1opts(msymbol(D) msize(medium) mcolor(red) lcolor(red) lwidth(medthick)) ci1opts(lcolor(red)) ///
        plot2opts(msymbol(O) msize(medium) mcolor(blue) lp(solid)  mlcolor(blue) lcolor(blue) lwidth(medthick)) ci2opts(lcolor(blue)) ///
		legend(off)

reg mainstream i.worse_econ##c.coni_assoc_1999##i.unemp_tercile i.education age i.male i.election_year i.regionen if regione!="`r'", vce(cluster regionen)

margins unemp_tercile, dydx(worse_econ) at(coni_assoc_1999=(0.5(.4)2.1))
mplotoffset,  offset(0.05) recast(scatter) ///
		name(coni_ter`r', replace) ///
		title("`r'") ///
		ytitle("", size(large)) ///
		xtitle("", size(large)) ///		
		yline(0, lw(thin) lstyle(foreground) ) ///
		ylabel(, grid glcolor(black%70) glw(thin) labs(medl)) ///
		xlabel(, nogrid) ///
		aspect(1) ///
		plot1opts(msymbol(D) msize(medium) mcolor(red) lcolor(red) lwidth(medthick)) ci1opts(lcolor(red)) ///
        plot3opts(msymbol(O) msize(medium) mcolor(blue) lp(solid)  mlcolor(blue) lcolor(blue) lwidth(medthick)) ci3opts(lcolor(blue)) ///
        plot2opts(msymbol(T) msize(medium) mcolor(orange) lp(solid)  mlcolor(orange) lcolor(orange) lwidth(medthick)) ci2opts(lcolor(orange)) ///
		legend(off)

}

graph combine 	ass_dummyABRUZZO ///
				ass_dummyBASILICATA  ///
				ass_dummyCALABRIA  ///
				ass_dummyCAMPANIA  ///				
				ass_dummyEMILIAROMAGNA  ///				
				ass_dummyFRIULIVENEZIAGIULIA  ///				
				ass_dummyLAZIO  ///				
				ass_dummyLIGURIA  ///				
				ass_dummyLOMBARDIA  ///				
				ass_dummyMARCHE  ///				
				ass_dummyMOLISE  ///				
				ass_dummyPIEMONTE  ///				
				ass_dummyPUGLIA  ///				
				ass_dummySARDEGNA  ///				
				ass_dummySICILIA  ///				
				ass_dummyTOSCANA  ///								
				ass_dummyTRENTINOALTOADIGE ///								
				ass_dummyUMBRIA  ///								
				ass_dummyVALLEDAOSTA  ///				
				ass_dummyVENETO  	

graph export "$folder/replication/figures/figA4.pdf", replace

graph combine 	coni_dummyABRUZZO ///
				coni_dummyBASILICATA  ///
				coni_dummyCALABRIA  ///
				coni_dummyCAMPANIA  ///				
				coni_dummyEMILIAROMAGNA  ///				
				coni_dummyFRIULIVENEZIAGIULIA  ///				
				coni_dummyLAZIO  ///				
				coni_dummyLIGURIA  ///				
				coni_dummyLOMBARDIA  ///				
				coni_dummyMARCHE  ///				
				coni_dummyMOLISE  ///				
				coni_dummyPIEMONTE  ///				
				coni_dummyPUGLIA  ///				
				coni_dummySARDEGNA  ///				
				coni_dummySICILIA  ///				
				coni_dummyTOSCANA  ///								
				coni_dummyTRENTINOALTOADIGE ///								
				coni_dummyUMBRIA  ///								
				coni_dummyVALLEDAOSTA  ///				
				coni_dummyVENETO 
graph export "$folder/replication/figures/figA5.pdf", replace
				
graph combine 	ass_terABRUZZO ///
				ass_terBASILICATA  ///
				ass_terCALABRIA  ///
				ass_terCAMPANIA  ///				
				ass_terEMILIAROMAGNA  ///				
				ass_terFRIULIVENEZIAGIULIA  ///				
				ass_terLAZIO  ///				
				ass_terLIGURIA  ///				
				ass_terLOMBARDIA  ///				
				ass_terMARCHE  ///				
				ass_terMOLISE  ///				
				ass_terPIEMONTE  ///				
				ass_terPUGLIA  ///				
				ass_terSARDEGNA  ///				
				ass_terSICILIA  ///				
				ass_terTOSCANA  ///								
				ass_terTRENTINOALTOADIGE ///								
				ass_terUMBRIA  ///								
				ass_terVALLEDAOSTA  ///				
				ass_terVENETO  
graph export "$folder/replication/figures/figA6.pdf", replace
												
graph combine 	coni_terABRUZZO ///
				coni_terBASILICATA  ///
				coni_terCALABRIA  ///
				coni_terCAMPANIA  ///				
				coni_terEMILIAROMAGNA  ///				
				coni_terFRIULIVENEZIAGIULIA  ///				
				coni_terLAZIO  ///				
				coni_terLIGURIA  ///				
				coni_terLOMBARDIA  ///				
				coni_terMARCHE  ///				
				coni_terMOLISE  ///				
				coni_terPIEMONTE  ///				
				coni_terPUGLIA  ///				
				coni_terSARDEGNA  ///				
				coni_terSICILIA  ///				
				coni_terTOSCANA  ///								
				coni_terTRENTINOALTOADIGE ///								
				coni_terUMBRIA  ///								
				coni_terVALLEDAOSTA  ///				
				coni_terVENETO
graph export "$folder/replication/figures/figA7.pdf", replace


